﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AOPCaching.Example
{
    class Program
    {
        static void Main(string[] args)
        {

            //DTO reference is set using business class
            MerchantProductDTO dto = MerchantProducts.GetDto(50);

            //DTO is loaded at first access (MerchantProducts.GetDto(50) gets actually executed now do to delay loading
            //DTO is cached
            String Model = dto.MerchantProductModel;

            //Previous DTO gets loaded from cache.
            //It gets uniquely identified thank to the Cache Identifiers attributes defined in the DTO class
            MerchantProductDTO dto2 = MerchantProducts.GetDtoByProductId(dto.ProductsId);
        }
    }
}
